#include <unistd.h>
#include <iostream>
using namespace std;
int main() {
   int ret;
   cout<<"系统进程id："<<getpid()<<"\n"<<"父进程ID："<<getppid()<<"\n";
   ret = system("ping -c 4 www.126.com");
   if(0 == ret)
       cout<<"进程调用成功"<<"\n";
   else if(127 == ret)
       cout<<"sh不能执行"<<"\n";
   else if(-1 == ret)
       cout<<"进程执行失败"<<"\n";
    return 0;
}